import { FC } from "react";
import { View, Text } from "@tarojs/components";
import styles from "./index.module.less";
import Sestion from "../sestion";
import { UserInfo } from "@/service/type";

interface IProps {
  customerInfo: UserInfo;
}

const MemberLabel: FC<IProps> = ({ customerInfo }) => {
  const characterTagsCn = customerInfo.customerCharacter?.characterTagsCn;
  const hobbyTagsCn = customerInfo.customerCharacter?.hobbyTagsCn;
  const labbels = characterTagsCn
    ?.split(",")
    .concat(hobbyTagsCn?.split(",") || []);
  return (
    <Sestion text="性格与兴趣">
      <View className={styles["label-wrapper"]}>
        {labbels?.map((item, index) => (
          <Text className={styles["item"]} key={index}>
            {item}
          </Text>
        ))}
      </View>
      {!labbels?.length && <View className={styles["hint"]}>暂无信息哦~</View>}
    </Sestion>
  );
};

export default MemberLabel;
